package cn.ljy.mes.service.impl;

import cn.ljy.authority.service.impl.IBaseService;
import cn.ljy.mes.model.ShopProductType;
import cn.ljy.mes.model.query.ShopProductTypeQuery;
import cn.ljy.mes.service.ShopProductTypeService;
import org.springframework.stereotype.Service;

import java.io.Serializable;

@Service
public class IShopProductTypeService extends IBaseService<ShopProductType, ShopProductTypeQuery> implements ShopProductTypeService {


    @Override
    protected void beforeDelete(Serializable[] ids) {
//        for(Serializable id:ids){
//            MesMaterialQuery materialQuery=new MesMaterialQuery();
//            materialQuery.setMaterialType(new MesMaterialType(Long.valueOf(id.toString())));
//            int materialNumber=mesMaterialMapper.count(materialQuery);
//            if(materialNumber>0){
//                MesMaterialType materialType=mapper.findByIdNoRelation(id);
//                throw new MyServiceException("删除失败："+materialType.getName()+"下还有"+materialNumber+"个物料在使用，请先移除或转移这些物料后再执行删除");
//            }
//        }
    }
}
